import Vue from 'vue'
import App from './App'

Vue.config.productionTip = false

App.mpType = 'app'
import ZAudio from '@/components/zaudio/index.js'
// import ZAudio from 'uniapp-zaudio' // npm引用方式

console.log('')
let zaudio = new ZAudio({
	continuePlay: true, //续播
	autoPlay: false, //自动播放 部分浏览器不支持
})
 
Vue.prototype.$zaudio = zaudio

var data = [
	{
		src: 'http://music.163.com/song/media/outer/url?id=16431842.mp3',
		title: 'Innocence',
		singer: 'Avril Lavigne',
		coverImgUrl: 'https://p1.music.126.net/JsjUOYJytWLfFsA-RaHLgQ==/109951163471012053.jpg?param=130y130'
	},
	{
		src: 'http://music.163.com/song/media/outer/url?id=1874170685.mp3',
		title: 'ROSÉ-Gone（ChillSUGA / ROSÉ remix）',
		singer: 'ChillSUGA / ROSÉ',
		coverImgUrl: 'https://p2.music.126.net/zBywIhprrNUYQZqliKZbTA==/109951166101215245.jpg?param=130y130'
	},
	{
		src: 'http://music.163.com/song/media/outer/url?id=475072054.mp3',
		title: 'Coming Home',
		singer: 'Dash Berlin / Bo Bruce',
		coverImgUrl: 'http://p2.music.126.net/FPSSG8LUz8v_kRpvEsJn9g==/109951166319408602.jpg?param=130y130'
	},
	{
		src: 'http://music.163.com/song/media/outer/url?id=30070142.mp3',
		title: 'Our Own Heaven',
		singer: 'Masetti',
		coverImgUrl: 'https://p2.music.126.net/fd_oAmORbPWfKxj1vEUDfg==/109951165002669062.jpg?param=130y130'
	},
	{
		src: 'http://music.163.com/song/media/outer/url?id=1405259103.mp3',
		title: 'Last Christmas',
		singer: 'Taylor Swift',
		coverImgUrl: 'https://p2.music.126.net/vOOwfpXlNzuKyov5X_-FOQ==/109951164502864760.jpg?param=130y130'
	},
	{
		src: 'http://music.163.com/song/media/outer/url?id=36496695.mp3',
		title: 'Love Yourself',
		singer: 'Justin Bieber',
		coverImgUrl: 'https://p1.music.126.net/SmaGv_bQTYy5_uOmnAz4Mw==/3285340746015046.jpg?param=130y130'
	},
	{
		src: 'http://music.163.com/song/media/outer/url?id=28788849.mp3',
		title: 'A Thousand Years',
		singer: 'Christina Perri',
		coverImgUrl: 'https://p1.music.126.net/bl_Dkotb0hqIzOKOqIJKyg==/6061607604610589.jpg?param=130y130'
	},
	{
		src: 'http://music.163.com/song/media/outer/url?id=1299818.mp3',
		title: 'Without Me',
		singer: 'Eminem',
		coverImgUrl: 'https://p2.music.126.net/mg_Ni1oPVpkMku2j8SHFGA==/911495139475934.jpg?param=130y130'
	},
	{
		src: 'http://music.163.com/song/media/outer/url?id=16432049.mp3',
		title: 'When You are Gone',
		singer: 'Avril Lavigne',
		coverImgUrl: 'https://p1.music.126.net/bWeVVpBK-EzsCTXMsgElcA==/109951163571593842.jpg?param=130y130'
	},
	{
		src: 'http://music.163.com/song/media/outer/url?id=2117894.mp3',
		title: 'Sk8er Boi',
		singer: 'Avril Lavigne',
		coverImgUrl: 'https://p2.music.126.net/IWVln4jmVbuBJ4YglMl-oA==/109951163077004164.jpg?param=130y130'
	},
	{
		src: 'http://music.163.com/song/media/outer/url?id=28635835.mp3',
		title: 'Call Me Maybe',
		singer: 'Carly Rae Jepson',
		coverImgUrl: 'https://p2.music.126.net/uu-w0oNMcm8gQV2vTDvvoQ==/5891183301866018.jpg?param=130y130'
	},
	];
	
	//https://m10.music.126.net/20211218221658/5928bf29cd6c19be067a004a2b65a76c/yyaac/obj/wonDkMOGw6XDiTHCmMOi/3036118452/e2d8/4003/da2d/2a793d74e1923afc9c35447a59dbbb48.m4a
//每天推荐一首歌2
function showMusicPerDay(){
	let time = new Date().getDate();
	let length = data.length;
	let showId = time % length;
	let showData=[];
	showData[0] = data[showId];
	// 设置音频数据
	zaudio.setAudio(showData);
}
showMusicPerDay()
//渲染第一首
zaudio.setRender(0)

// 引入全局uView
import uView from 'uview-ui'
Vue.use(uView);

const app = new Vue({
    ...App
})
app.$mount()
